![]() |
DrawThemeButton |
||||
Header: | Appearance.h | Carbon status: | Supported | |
Draws a button.
OSStatus DrawThemeButton ( const Rect *inBounds, ThemeButtonKind inKind, const ThemeButtonDrawInfo *inNewInfo, const ThemeButtonDrawInfo *inPrevInfo, ThemeEraseUPP inEraseProc, ThemeButtonDrawUPP inLabelProc, UInt32 inUserData );
A pointer to a structure of type Rect. Pass a rectangle specifying the boundary of the button, in local coordinates.
A value of type ThemeButtonKind. Pass a constant specifying the type of button to draw. See
A pointer to a structure of type ThemeButtonDrawInfo. Before calling DrawThemeButton, set the structure to contain the new state, value, and adornment for the button. DrawThemeButton uses the information passed in the inNewInfo and inPrevInfo parameters to apply transitional animation or sound effects as the button state changes, if such are specified under the current theme.
A pointer to a structure of type ThemeButtonDrawInfo. If the button state is changing, set the structure to contain the previous state, value, and adornment for the button, to allow DrawThemeButton to apply any transitional effects. If the button state is not changing, you can pass NULL.
A value of type ThemeEraseUPP. If you have a custom background, pass a universal function pointer to an application-defined function such as that described in ThemeEraseProcPtr. DrawThemeButton calls that function to erase the background before drawing the button. If you pass NULL, no erasing occurs.
A value of type ThemeButtonDrawUPP. If you pass a universal function pointer to an application-defined function such as that described in ThemeButtonDrawProcPtr, DrawThemeButton calls that function to draw the label of the button. If you pass NULL, no label is drawn.
An unsigned 32-bit integer. Provide any data to be passed in to the callback functions specified in the inLabelProc and inEraseProc parameters. Pass NULL if you do not wish to provide any data.
A result code.
The DrawThemeButton function draws a theme-compliant button. If a ThemeEraseProcPtr is specified in the inEraseProc parameter, DrawThemeButton uses that function to erase the background of the button before drawing the button. After the button is drawn, if a ThemeButtonDrawProcPtr is specified in the inLabelProc parameter, DrawThemeButton calls that function to draw the button’s label.
Note that DrawThemeButton also draws any appearance adornments for the button and that these can extend beyond the button’s basic bounding rectangle, as specified in the inBounds parameter, and may be of variable shape. You may therefore wish to call the function GetThemeButtonBackgroundBounds to obtain the actual rectangle containing the pixels belonging to a button under the current theme.
This function is available with Appearance Manager 1.1 and later.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)